SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
/*WHERE     (dbo.tb_Alumnos.Documento IN (SELECT     documento  FROM          documentosAprocesarBecas))




*/
CREATE VIEW dbo.vw_BecasYPrestamos05
AS
SELECT     dbo.tb_Alumnos.idAlumno, dbo.tb_Alumnos.Documento, UPPER(dbo.tb_Alumnos.Apellidos) + ' ' + UPPER(dbo.tb_Alumnos.Nombres) AS Nombres, 
                      UPPER(dbo.tb_Alumnos.Calle) as Calle, dbo.tb_Alumnos.Numero, dbo.tb_Alumnos.Telefono, UPPER(dbo.tb_Localidades.localidad) AS Localidad, 
                      dbo.tb_Alumnos.FechaNacimiento, dbo.tb_Alumnos.DocRepresentanteBecas, UPPER(dbo.tb_Alumnos.NombreRepresentanteBecas) as NombreRepresentanteBecas, 
                      dbo.tb_LineasDeBYP.Descripcion AS Linea, dbo.tb_PeriodosDeLiquidacion.Descripcion AS Período, dbo.tb_LineasDeBYP.FechaOtorga, 
                      dbo.tb_LineasDeBYP.MontoMensual, UPPER(dbo.tb_NivelesEnsenanza.NivelEnsenanza) AS Nivel, 
                      dbo.tb_TipoBecaOPrestamo.descripcion AS TipoByP, dbo.tb_LiquidacionBYP.Año, dbo.tb_LiquidacionBYP.NumeroPeriodo, 
                      dbo.tb_Localidades.idLocalidad AS IdLocalidad, dbo.tb_LineasDeBYP.idTipoBecaOprestamo, dbo.tb_BecasYPrestamos.MostrarEnListado
FROM         dbo.tb_Alumnos INNER JOIN
                      dbo.tb_BecasYPrestamos ON dbo.tb_Alumnos.idAlumno = dbo.tb_BecasYPrestamos.Alumno INNER JOIN
                      dbo.tb_LineasDeBYP ON dbo.tb_BecasYPrestamos.LineaDeByP = dbo.tb_LineasDeBYP.idLineaDeBYP INNER JOIN
                      dbo.tb_PeriodosDeLiquidacion ON dbo.tb_LineasDeBYP.idPeriodoLiq = dbo.tb_PeriodosDeLiquidacion.idPeriodoLiquidacion INNER JOIN
                      dbo.tb_TipoBecaOPrestamo ON dbo.tb_LineasDeBYP.idTipoBecaOprestamo = dbo.tb_TipoBecaOPrestamo.idTipoBecaoPrestamo INNER JOIN
                      dbo.tb_Localidades ON dbo.tb_Alumnos.Localidad = dbo.tb_Localidades.idLocalidad INNER JOIN
                      dbo.tb_LiquidacionBYP ON dbo.tb_LineasDeBYP.idLineaDeBYP = dbo.tb_LiquidacionBYP.IdLineaDeByP LEFT OUTER JOIN
                      dbo.tb_NivelesEnsenanza ON dbo.tb_LineasDeBYP.idNivel = dbo.tb_NivelesEnsenanza.idNivelEnsenanza

GO
GRANT SELECT ON  [dbo].[vw_BecasYPrestamos05] TO [SoloVer]
GO
EXEC sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[42] 4[13] 2[35] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1[50] 2[25] 3) )"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1 [56] 4 [18] 2))"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -384
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tb_Alumnos"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 114
               Right = 255
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_BecasYPrestamos"
            Begin Extent = 
               Top = 114
               Left = 38
               Bottom = 222
               Right = 227
            End
            DisplayFlags = 280
            TopColumn = 9
         End
         Begin Table = "tb_LineasDeBYP"
            Begin Extent = 
               Top = 114
               Left = 265
               Bottom = 222
               Right = 454
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_PeriodosDeLiquidacion"
            Begin Extent = 
               Top = 222
               Left = 38
               Bottom = 300
               Right = 227
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_TipoBecaOPrestamo"
            Begin Extent = 
               Top = 222
               Left = 265
               Bottom = 300
               Right = 454
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_LiquidacionBYP"
            Begin Extent = 
               Top = 300
               Left = 265
               Bottom = 408
               Right = 454
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_NivelesEnsenanza"
            Begin Extent = 
               Top = 396
               Left = 38
               Bottom = 474', 'USER', N'dbo', 'VIEW', N'vw_BecasYPrestamos05', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_DiagramPane2', N'
               Right = 227
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Localidades"
            Begin Extent = 
               Top = 2086
               Left = 321
               Bottom = 2201
               Right = 511
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      RowHeights = 220
      Begin ColumnWidths = 22
         Width = 284
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 2985
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
         Width = 1440
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
', 'USER', N'dbo', 'VIEW', N'vw_BecasYPrestamos05', NULL, NULL
GO
DECLARE @xp int
SELECT @xp=2
EXEC sp_addextendedproperty N'MS_DiagramPaneCount', @xp, 'USER', N'dbo', 'VIEW', N'vw_BecasYPrestamos05', NULL, NULL
GO
